<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
	<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
	<link rel="shortcut icon" type="image/png" href="/favicon.png">

	
	<link rel="stylesheet" href="/css/style.css">
	<link rel="stylesheet" href="/css/css/fontawesome-all.min.css">
	<script src="/js/main.js"></script>
	

	<!-- Begin Jekyll SEO tag v2.1.0 -->
<title>PY: Get Posts - Steem Developer</title>
<meta property="og:title" content="PY: Get Posts" />
<meta name="description" content="This tutorial pulls a list of the posts from the blockchain with selected filter and tag then displays output" />
<meta property="og:description" content="This tutorial pulls a list of the posts from the blockchain with selected filter and tag then displays output" />
<link rel="canonical" href="https://developer.steem.io/tutorials-python/get_posts" />
<meta property="og:url" content="https://developer.steem.io/tutorials-python/get_posts" />
<meta property="og:site_name" content="Steem Developer" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2018-07-20T12:56:08-05:00" />
<script type="application/ld+json">
{"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "PY: Get Posts",
"datePublished": "2018-07-20T12:56:08-05:00",
"description": "This tutorial pulls a list of the posts from the blockchain with selected filter and tag then displays output",
"url": "https://developer.steem.io/tutorials-python/get_posts"}</script>
<!-- End Jekyll SEO tag -->


	
</head>
<body>
<header>
	<h1>
		<button type="button" class="open-nav" id="open-nav"></button>
		<a href="/"  class="logo-link"><img src="/images/logotype_white.svg" height="40" alt="Steem Developer logo"></a>
	</h1>

	
	<form action="/search/" method="get">
		<input type="text" name="q" id="search-input" placeholder="Search">
		<input type="submit" value="Search" style="display: none;">
	</form>
	

	<div id="sidebar" class="sidebar">
	
	
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/">
		<h6 class="ctrl-nav-section title">Introduction</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/#introduction-welcome">Welcome to Steem</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/quickstart/">
		<h6 class="ctrl-nav-section title">Quickstart</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/quickstart/#quickstart-choose-library">Choose Library</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-steemd-nodes">steemd Nodes</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-testnet">Steem Testnet</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/tutorials/">
		<h6 class="ctrl-nav-section title">Tutorials</h6>
		<ul class="cont-nav-section content">
			
				
					
						<li><a href="/tutorials/#tutorials-javascript">Javascript</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-python">Python</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-ruby">Ruby</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-recipes">Recipes</a></li>
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/services/">
		<h6 class="ctrl-nav-section title">Services</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/services/#services-steemit">Steemit.com</a></li>
						
					
						
						<li><a href="/services/#services-steemconnect">SteemConnect</a></li>
						
					
						
						<li><a href="/services/#services-jussi">jussi</a></li>
						
					
						
						<li><a href="/services/#services-imagehoster">ImageHoster</a></li>
						
					
						
						<li><a href="/services/#services-sbds">SBDS</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/apidefinitions/">
		<h6 class="ctrl-nav-section title">Appbase API</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/apidefinitions/#apidefinitions-condenser-api">Condenser Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-by-key-api">Account By Key Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops-comment">Broadcast Ops Comment</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-history-api">Account History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-database-api">Database Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-follow-api">Follow Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-jsonrpc">Jsonrpc</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-market-history-api">Market History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-network-broadcast-api">Network Broadcast Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-tags-api">Tags Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-witness-api">Witness Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-block-api">Block Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops">Broadcast Ops</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/community/">
		<h6 class="ctrl-nav-section title">Community</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/community/#community-overview">Overview</a></li>
						
					
						
						<li><a href="/community/#community-resources">Resources</a></li>
						
					
						
						<li><a href="/community/#community-developeradvocate">Sharing & Help</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/glossary/">
		<h6 class="ctrl-nav-section title">Glossary</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/glossary/#glossary-chain-basics">Chain Basics</a></li>
						
					
						
					
						
						<li><a href="/glossary/#glossary-governance">Governance</a></li>
						
					
						
						<li><a href="/glossary/#glossary-transactions">Transactions</a></li>
						
					
						
						<li><a href="/glossary/#glossary-api">API</a></li>
						
					
						
						<li><a href="/glossary/#glossary-market">Market</a></li>
						
					
				
			
		</ul>
	</section>
	
</div>


	<!--<p class="copyright">-->
	<!--<a href="https://steemit.com.com/">-->
	<!--steemit-->
	<!--</a>-->
	<!--</p>-->
	<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
</header>
<div class="main" id="top">
	<div class="hero">
		<h1 class="hero__h1">Steem Developer Portal </h1>
		
		<img class="hero__img" src="/images/hero.png">
		
	</div>
	<section id="tutorials-python-get-posts" class="row tutorials-python-get-posts">
	<h3>
		<a id="tutorials-python-get-posts">
			PY: Get Posts
			
		</a>
	</h3>
	
		<p class="description">This tutorial pulls a list of the posts from the blockchain with selected filter and tag then displays output</p>
	

	<p><span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of <a href="https://github.com/steemit/devportal-tutorials-py/tree/master/tutorials/01_get_posts">Get Posts</a> can be downloaded as part of the <a href="https://github.com/steemit/devportal-tutorials-py">PY tutorials repository</a>.</span>
<br /></p>

<p>This tutorial will explain and show you how to access the <strong>Steem</strong> blockchain using the <a href="https://github.com/steemit/steem-python">steem-python</a> library to fetch list of posts filtered by a <em>filter</em> and <em>tag</em></p>

<h2 id="intro">Intro</h2>

<p>All python tutorials will be in Python3 and developers following these tutorials should have sufficient knowlegde to use pip/pip3 package manager. Your development environment should be set up properly to test these tutorials.</p>

<p>In Steem there are built-in filters <code class="highlighter-rouge">trending</code>, <code class="highlighter-rouge">hot</code>, <code class="highlighter-rouge">created</code>, <code class="highlighter-rouge">active</code>, <code class="highlighter-rouge">promoted</code> etc. which helps us to get list of posts. <code class="highlighter-rouge">get_discussions_by_trending(query)</code>, <code class="highlighter-rouge">get_discussions_by_hot(query)</code>, <code class="highlighter-rouge">get_discussions_by_created(query)</code>, etc. functions are built-in in official library <code class="highlighter-rouge">steem-python</code> that we are going to use throughout all Python tutorials.</p>

<h2 id="steps">Steps</h2>

<ol>
  <li><a href="#app-setup"><strong>App setup</strong></a> - Library install and import</li>
  <li><a href="#filters-list"><strong>Filters list</strong></a> - List of filters to select from</li>
  <li><a href="#query-details"><strong>Query details</strong></a> - Form a query</li>
  <li><a href="#print-output"><strong>Print output</strong></a> - Print results in output</li>
</ol>

<h4 id="1-app-setup-">1. App setup <a name="app-setup"></a></h4>

<p>In this tutorial we use 3 packages, <code class="highlighter-rouge">pick</code> - helps us to select filter interactively. <code class="highlighter-rouge">steem</code> - steem-python library, interaction with Blockchain. <code class="highlighter-rouge">pprint</code> - print results in better format.</p>

<p>First we import all three library and initialize Steem class</p>

<div class="language-python highlighter-rouge"><pre class="highlight"><code>    <span class="kn">import</span> <span class="nn">pprint</span>
    <span class="kn">from</span> <span class="nn">pick</span> <span class="kn">import</span> <span class="n">pick</span>
    <span class="c"># initialize Steem class</span>
    <span class="kn">from</span> <span class="nn">steem</span> <span class="kn">import</span> <span class="n">Steem</span>

    <span class="n">s</span> <span class="o">=</span> <span class="n">Steem</span><span class="p">()</span>
</code></pre>
</div>

<h4 id="2-filters-list-">2. Filters list <a name="filters-list"></a></h4>

<p>Next we will make list of filters and setup <code class="highlighter-rouge">pick</code> properly.</p>

<div class="language-python highlighter-rouge"><pre class="highlight"><code>    <span class="n">title</span> <span class="o">=</span> <span class="s">'Please choose filter: '</span>
    <span class="c">#filters list</span>
    <span class="n">options</span> <span class="o">=</span> <span class="p">[</span><span class="s">'trending'</span><span class="p">,</span> <span class="s">'hot'</span><span class="p">,</span> <span class="s">'active'</span><span class="p">,</span> <span class="s">'created'</span><span class="p">,</span> <span class="s">'promoted'</span><span class="p">]</span>
    <span class="c"># get index and selected filter name</span>
    <span class="n">option</span><span class="p">,</span> <span class="n">index</span> <span class="o">=</span> <span class="n">pick</span><span class="p">(</span><span class="n">options</span><span class="p">,</span> <span class="n">title</span><span class="p">)</span>
</code></pre>
</div>

<p>This will show us list of filters to select in terminal/command prompt. And after selection we will get index and filter name to <code class="highlighter-rouge">index</code> and <code class="highlighter-rouge">option</code> variables.</p>

<h4 id="3-query-details-">3. Query details <a name="query-details"></a></h4>

<p>Next we will form a query. In Steem,</p>

<ul>
  <li>You can add a tag to filter the posts that you receive from the server</li>
  <li>You can also limit the amount of results you would like to receive from the query</li>
</ul>

<div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="n">query</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s">"limit"</span><span class="p">:</span><span class="mi">2</span><span class="p">,</span> <span class="c">#number of posts</span>
    <span class="s">"tag"</span><span class="p">:</span><span class="s">""</span> <span class="c">#tag of posts</span>
    <span class="p">}</span>
<span class="c">#post list for selected query</span>
<span class="n">posts</span> <span class="o">=</span> <span class="p">{</span><span class="mi">0</span><span class="p">:</span> <span class="n">s</span><span class="o">.</span><span class="n">get_discussions_by_trending</span><span class="p">(</span><span class="n">query</span><span class="p">),</span>
         <span class="mi">1</span><span class="p">:</span> <span class="n">s</span><span class="o">.</span><span class="n">get_discussions_by_hot</span><span class="p">(</span><span class="n">query</span><span class="p">),</span>
         <span class="mi">2</span><span class="p">:</span> <span class="n">s</span><span class="o">.</span><span class="n">get_discussions_by_active</span><span class="p">(</span><span class="n">query</span><span class="p">),</span>
         <span class="mi">3</span><span class="p">:</span> <span class="n">s</span><span class="o">.</span><span class="n">get_discussions_by_created</span><span class="p">(</span><span class="n">query</span><span class="p">),</span>
         <span class="mi">4</span><span class="p">:</span> <span class="n">s</span><span class="o">.</span><span class="n">get_discussions_by_promoted</span><span class="p">(</span><span class="n">query</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>
</div>

<p>Above code shows example of query and simple list of function that will fetch post list with user selected filter.</p>

<h4 id="4-print-output-">4. Print output <a name="print-output"></a></h4>

<p>Next, we will print result, post list and selected filter name.</p>

<div class="language-python highlighter-rouge"><pre class="highlight"><code>    <span class="c"># print post list for selected filter</span>
    <span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="n">posts</span><span class="p">[</span><span class="n">index</span><span class="p">])</span>
    <span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="s">"Selected: "</span><span class="o">+</span><span class="n">option</span><span class="p">)</span>
</code></pre>
</div>

<p>The example of result returned from the service is a <code class="highlighter-rouge">JSON</code> object with the following properties:</p>

<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
        </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">37338948</span><span class="p">,</span><span class="w">
        </span><span class="nt">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"steemitblog"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"permlink"</span><span class="p">:</span><span class="w"> </span><span class="s2">"join-team-steemit-at-tokenfest"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"category"</span><span class="p">:</span><span class="w"> </span><span class="s2">"steemit"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"parent_author"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
        </span><span class="nt">"parent_permlink"</span><span class="p">:</span><span class="w"> </span><span class="s2">"steemit"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Join Team Steemit at TokenFest!"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"body"</span><span class="p">:</span><span class="w">
            </span><span class="s2">"&lt;a href=\"https://tokenfest.adria.digital\"&gt;&lt;img src=\"https://i.imgur.com/fOScDIW.png\"/&gt;&lt;/a&gt;\n\nHello Steemians! If you’d like to meet Team Steemit live-in-person, or are just interested in attending what promises to be a great blockchain conference, join us at &lt;a href=\"https://tokenfest.adria.digital/\"&gt;TokenFest&lt;/a&gt; in San Francisco from March 15th to 16th. \n\nSteemit CEO, Ned Scott, will be participating in a fireside chat alongside Steemit’s CTO, Harry Schmidt, as well as the creator of Utopian.io, Diego Pucci. Steemit will also be hosting the opening party on Thursday night and we’d certainly love to meet as many of you as possible IRL, so head on over to https://tokenfest.adria.digital/ and get your tickets while you can. \n\n*Team Steemit*"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"json_metadata"</span><span class="p">:</span><span class="w">
            </span><span class="s2">"{\"tags\":[\"steemit\",\"tokenfest\",\"conference\"],\"image\":[\"https://i.imgur.com/fOScDIW.png\"],\"links\":[\"https://tokenfest.adria.digital\",\"https://tokenfest.adria.digital/\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"last_update"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-07T23:22:54"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"created"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-07T20:56:36"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"active"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-13T01:40:21"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"last_payout"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1970-01-01T00:00:00"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"depth"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
        </span><span class="nt">"children"</span><span class="p">:</span><span class="w"> </span><span class="mi">29</span><span class="p">,</span><span class="w">
        </span><span class="nt">"net_rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"11453442114933"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"abs_rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"11454054795840"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"vote_rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"11454054795840"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"children_abs_rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"13568695606090"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"cashout_time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-14T20:56:36"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"max_cashout_time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1969-12-31T23:59:59"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"total_vote_weight"</span><span class="p">:</span><span class="w"> </span><span class="mi">3462435</span><span class="p">,</span><span class="w">
        </span><span class="nt">"reward_weight"</span><span class="p">:</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
        </span><span class="nt">"total_payout_value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 SBD"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"curator_payout_value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 SBD"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"author_rewards"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
        </span><span class="nt">"net_votes"</span><span class="p">:</span><span class="w"> </span><span class="mi">77</span><span class="p">,</span><span class="w">
        </span><span class="nt">"root_comment"</span><span class="p">:</span><span class="w"> </span><span class="mi">37338948</span><span class="p">,</span><span class="w">
        </span><span class="nt">"max_accepted_payout"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 SBD"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"percent_steem_dollars"</span><span class="p">:</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
        </span><span class="nt">"allow_replies"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
        </span><span class="nt">"allow_votes"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
        </span><span class="nt">"allow_curation_rewards"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
        </span><span class="nt">"beneficiaries"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="nt">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/steemit/@steemitblog/join-team-steemit-at-tokenfest"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"root_title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Join Team Steemit at TokenFest!"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"pending_payout_value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"46.436 SBD"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"total_pending_payout_value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 STEEM"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"active_votes"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
                </span><span class="nt">"voter"</span><span class="p">:</span><span class="w"> </span><span class="s2">"steemitblog"</span><span class="p">,</span><span class="w">
                </span><span class="nt">"weight"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
                </span><span class="nt">"rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1870813909383"</span><span class="p">,</span><span class="w">
                </span><span class="nt">"percent"</span><span class="p">:</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
                </span><span class="nt">"reputation"</span><span class="p">:</span><span class="w"> </span><span class="s2">"128210130644387"</span><span class="p">,</span><span class="w">
                </span><span class="nt">"time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-07T20:56:36"</span><span class="w">
            </span><span class="p">},</span><span class="w">
            </span><span class="p">{</span><span class="w">
                </span><span class="nt">"voter"</span><span class="p">:</span><span class="w"> </span><span class="s2">"kevinwong"</span><span class="p">,</span><span class="w">
                </span><span class="nt">"weight"</span><span class="p">:</span><span class="w"> </span><span class="mi">526653</span><span class="p">,</span><span class="w">
                </span><span class="nt">"rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2208942520687"</span><span class="p">,</span><span class="w">
                </span><span class="nt">"percent"</span><span class="p">:</span><span class="w"> </span><span class="mi">5000</span><span class="p">,</span><span class="w">
                </span><span class="nt">"reputation"</span><span class="p">:</span><span class="w"> </span><span class="s2">"374133832002581"</span><span class="p">,</span><span class="w">
                </span><span class="nt">"time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-08T04:27:00"</span><span class="w">
            </span><span class="p">}</span><span class="w">
        </span><span class="p">],</span><span class="w">
        </span><span class="nt">"replies"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="nt">"author_reputation"</span><span class="p">:</span><span class="w"> </span><span class="s2">"128210130644387"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"promoted"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 SBD"</span><span class="p">,</span><span class="w">
        </span><span class="nt">"body_length"</span><span class="p">:</span><span class="w"> </span><span class="mi">754</span><span class="p">,</span><span class="w">
        </span><span class="nt">"reblogged_by"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">

    </span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span><span class="err">'Selected:</span><span class="w"> </span><span class="err">hot'</span><span class="w">
</span></code></pre>
</div>

<p>From this result you have access to everything associated to the posts including additional metadata which is a <code class="highlighter-rouge">JSON</code> string (that must be decoded to use), <code class="highlighter-rouge">active_votes</code> info, post title, body, etc. details that can be used in further development of application with Python.</p>

<p>That’s it!</p>

<h3 id="to-run-the-tutorial">To Run the tutorial</h3>

<ol>
  <li>clone this repo</li>
  <li><code class="highlighter-rouge">cd tutorials/01_get_posts</code></li>
  <li><code class="highlighter-rouge">pip install -r requirements.txt</code></li>
  <li><code class="highlighter-rouge">python index.py</code></li>
  <li>After a few moments, you should see output in terminal/command prompt screen.</li>
</ol>

<hr />

</section>

</div>
<div class="footer">
	<a href="#">Back to top</a>
</div>
<script>
    document.getElementById("open-nav").addEventListener("click", function () {
        document.body.classList.toggle("nav-open");
    });
</script>
</body>
</html>


<script src="/js/adjust.js"></script>

